<template>
	<div>
		<el-row  v-if="!detailShow">
			<el-col :span="1" class="labelCol">
				<p class="labelText">选择月份:</p>
			</el-col>
			<el-col :span="4">
				<el-date-picker size="small" v-model="time" format="yyyy-MM" :editable=false type="month" placeholder="月份">
				</el-date-picker>
			</el-col>
			<el-col :span="10">
				<el-button type="primary" size="small" v-on:click='baseQuery'>查询</el-button>
				<el-button type="primary" size="small" v-on:click="processOut">导出</el-button>
				<el-button type="primary" size="small" v-on:click='lookReport'>报表说明</el-button>
								<el-button class="el-icon-menu" type="primary" size="small" v-on:click='change'></el-button>

			</el-col>

		</el-row>
		<div v-if="table&&!detailShow" style="display:block">
			<div class="report_Fixedwidth">
				<table cellspacing="0" id="lostBack" cellpadding="0" width="1800px" class="report_table">
					<tbody>
						<tr class="texttbody">
							<th scope="col" rowspan="2" colspan="4">公司</th>
							<th scope="col" rowspan="2" colspan="4">客户经理</th>
							<th scope="col" colspan="3">六个月</th>
							<th scope="col" colspan="3">七个月</th>
							<th scope="col" colspan="3">八个月</th>
							<th scope="col" colspan="3">九个月</th>
							<th scope="col" colspan="3">十个月</th>
							<th scope="col" colspan="3">十一个月</th>
							<th scope="col" colspan="3">十二个月</th>
							<th scope="col" colspan="3">十三个月</th>
							<th scope="col" colspan="2" rowspan="2">流失总计</th>
							<th scope="col" colspan="2" rowspan="2">回厂总计</th>
							<th scope="col" colspan="2" rowspan="2">回厂率总计</th>
						</tr>
						<tr class="texttbody">
							<td style="width: 55px">任务数</td>
							<td style="width: 55px">回厂数</td>
							<td style="width: 55px">回厂率</td>
							<td style="width: 55px">任务数</td>
							<td style="width: 55px">回厂数</td>
							<td style="width: 55px">回厂率</td>
							<td style="width: 55px">任务数</td>
							<td style="width: 55px">回厂数</td>
							<td style="width: 55px">回厂率</td>
							<td style="width: 55px">任务数</td>
							<td style="width: 55px">回厂数</td>
							<td style="width: 55px">回厂率</td>
							<td style="width: 55px">任务数</td>
							<td style="width: 55px">回厂数</td>
							<td style="width: 55px">回厂率</td>
							<td style="width: 55px">任务数</td>
							<td style="width: 55px">回厂数</td>
							<td style="width: 55px">回厂率</td>
							<td style="width: 55px">任务数</td>
							<td style="width: 55px">回厂数</td>
							<td style="width: 55px">回厂率</td>
							<td style="width: 55px">任务数</td>
							<td style="width: 55px">回厂数</td>
							<td style="width: 55px">回厂率</td>
						</tr>
						<tr v-for="item in tableData.dataList">
							<td colspan="4">{{item.oName}}</td>
							<td colspan="4">{{item.SA}}</td>
							<td>
								<div v-if="item.sixTaskNum != '0'">
									<el-button type="text" @click="lookdetail(item,'0','6')">{{item.sixTaskNum}}</el-button>
								</div>
								<div v-if="item.sixTaskNum == '0'">
									{{item.sixTaskNum}}
								</div>
							</td>
							<td>
								<div v-if="item.sixTaskBackNum != '0'">
									<el-button type="text" @click="lookdetail(item,'1','6')">{{item.sixTaskBackNum}}</el-button>
								</div>
								<div v-if="item.sixTaskBackNum == '0'">
									{{item.sixTaskBackNum}}
								</div>
							</td>
							<td>{{item.sixTaskNum=='0'||item.sixTaskBackNum=='0'?"0.00%":parseFloat(item.sixTaskBackNum*100/item.sixTaskNum).toFixed(2)+"%"}}</td>
							<td>
								<div v-if="item.sevenTaskNum != '0'">
									<el-button type="text" @click="lookdetail(item,'0','7')">{{item.sevenTaskNum}}</el-button>
								</div>
								<div v-if="item.sevenTaskNum == '0'">
									{{item.sevenTaskNum}}
								</div>
							</td>
							<td>
								<div v-if="item.sevenTaskBackNum != '0'">
									<el-button type="text" @click="lookdetail(item,'1','7')">{{item.sevenTaskBackNum}}</el-button>
								</div>
								<div v-if="item.sevenTaskBackNum == '0'">
									{{item.sevenTaskBackNum}}
								</div>
							</td>
							<td>{{item.sevenTaskNum=='0'||item.sevenTaskBackNum=='0'?"0.00%":parseFloat(item.sevenTaskBackNum*100/item.sevenTaskNum).toFixed(2)+"%"}}</td>
							<td>
								<div v-if="item.eightTaskNum != '0'">
									<el-button type="text" @click="lookdetail(item,'0','8')">{{item.eightTaskNum}}</el-button>
								</div>
								<div v-if="item.eightTaskNum == '0'">
									{{item.eightTaskNum}}
								</div>
							</td>
							<td>
								<div v-if="item.eightTaskBackNum != '0'">
									<el-button type="text" @click="lookdetail(item,'1','8')">{{item.eightTaskBackNum}}</el-button>
								</div>
								<div v-if="item.eightTaskBackNum == '0'">
									{{item.eightTaskBackNum}}
								</div>
							</td>
							<td>{{item.eightTaskNum=='0'||item.eightTaskBackNum=='0'?"0.00%":parseFloat(item.eightTaskBackNum*100/item.eightTaskNum).toFixed(2)+"%"}}</td>
							<td>
								<div v-if="item.nineTaskNum != '0'">
									<el-button type="text" @click="lookdetail(item,'0','9')">{{item.nineTaskNum}}</el-button>
								</div>
								<div v-if="item.nineTaskNum == '0'">
									{{item.nineTaskNum}}
								</div>
							</td>
							<td>
								<div v-if="item.nineTaskBackNum != '0'">
									<el-button type="text" @click="lookdetail(item,'1','9')">{{item.nineTaskBackNum}}</el-button>
								</div>
								<div v-if="item.nineTaskBackNum == '0'">
									{{item.nineTaskBackNum}}
								</div>
							</td>
							<td>{{item.nineTaskNum=='0'||item.nineTaskBackNum=='0'?"0.00%":parseFloat(item.nineTaskBackNum*100/item.nineTaskNum).toFixed(2)+"%"}}</td>
							<td>
								<div v-if="item.tenTaskNum != '0'">
									<el-button type="text" @click="lookdetail(item,'0','10')">{{item.tenTaskNum}}</el-button>
								</div>
								<div v-if="item.tenTaskNum == '0'">
									{{item.tenTaskNum}}
								</div>
							</td>
							<td>
								<div v-if="item.tenTaskBackNum != '0'">
									<el-button type="text" @click="lookdetail(item,'1','10')">{{item.tenTaskBackNum}}</el-button>
								</div>
								<div v-if="item.tenTaskBackNum == '0'">
									{{item.tenTaskBackNum}}
								</div>
							</td>
							<td>{{item.tenTaskNum=='0'||item.tenTaskBackNum=='0'?"0.00%":parseFloat(item.tenTaskBackNum*100/item.tenTaskNum).toFixed(2)+"%"}}</td>
							<td>
								<div v-if="item.elevTaskNum != '0'">
									<el-button type="text" @click="lookdetail(item,'0','11')">{{item.elevTaskNum}}</el-button>
								</div>
								<div v-if="item.elevTaskNum == '0'">
									{{item.elevTaskNum}}
								</div>
							</td>
							<td>
								<div v-if="item.elevTaskBackNum != '0'">
									<el-button type="text" @click="lookdetail(item,'1','11')">{{item.elevTaskBackNum}}</el-button>
								</div>
								<div v-if="item.elevTaskBackNum == '0'">
									{{item.elevTaskBackNum}}
								</div>
							</td>
							<td>{{item.elevTaskNum=='0'||item.elevTaskBackNum=='0'?"0.00%":parseFloat(item.elevTaskBackNum*100/item.elevTaskNum).toFixed(2)+"%"}}</td>
							<td>
								<div v-if="item.twlfTaskNum != '0'">
									<el-button type="text" @click="lookdetail(item,'0','12')">{{item.twlfTaskNum}}</el-button>
								</div>
								<div v-if="item.twlfTaskNum == '0'">
									{{item.twlfTaskNum}}
								</div>
							</td>
							<td>
								<div v-if="item.twlfTaskBackNum != '0'">
									<el-button type="text" @click="lookdetail(item,'1','12')">{{item.twlfTaskBackNum}}</el-button>
								</div>
								<div v-if="item.twlfTaskBackNum == '0'">
									{{item.twlfTaskBackNum}}
								</div>
							</td>
							<td>{{item.twlfTaskNum=='0'||item.twlfTaskBackNum=='0'?"0.00%":parseFloat(item.twlfTaskBackNum*100/item.twlfTaskNum).toFixed(2)+"%"}}</td>
							<td>
								<div v-if="item.thirTaskNum != '0'">
									<el-button type="text" @click="lookdetail(item,'0','13')">{{item.thirTaskNum}}</el-button>
								</div>
								<div v-if="item.thirTaskNum == '0'">
									{{item.thirTaskNum}}
								</div>
							</td>
							<td>
								<div v-if="item.thirTaskBackNum != '0'">
									<el-button type="text" @click="lookdetail(item,'1','13')">{{item.thirTaskBackNum}}</el-button>
								</div>
								<div v-if="item.thirTaskBackNum == '0'">
									{{item.thirTaskBackNum}}
								</div>
							</td>
							<td>{{item.thirTaskNum=='0'||item.thirTaskBackNum=='0'?"0.00%":parseFloat(item.thirTaskBackNum*100/item.thirTaskNum).toFixed(2)+"%"}}</td>

							<td colspan="2">
								<div v-if="item.lsTaskNum != '0'">
									<el-button type="text" @click="lookdetail(item,'0','')">{{item.lsTaskNum}}</el-button>
								</div>
								<div v-if="item.lsTaskNum == '0'">
									{{item.lsTaskNum}}
								</div>
							</td>
							<td colspan="2">
								<div v-if="item.lsTaskBackNum != '0'">
									<el-button type="text" @click="lookdetail(item,'1','')">{{item.lsTaskBackNum}}</el-button>
								</div>
								<div v-if="item.lsTaskBackNum == '0'">
									{{item.lsTaskBackNum}}
								</div>
							</td>
							<td>{{item.lsTaskNum=='0'||item.lsTaskBackNum=='0'?"0.00%":parseFloat(item.lsTaskBackNum*100/item.lsTaskNum).toFixed(2)+"%"}}</td>
						</tr>

					</tbody>
				</table>
			</div>
		</div>
		<el-row :gutter="24" v-if="detailShow">
			<el-col :span="24" style="text-align: right;">
				<el-button type="primary" size="small" @click="back">返回</el-button>
			</el-col>
		</el-row>
		<el-row :gutter="24" v-if="detailShow">
			<el-table :data="detailData.dataList" border>
				<el-table-column prop="typeName" label="类别" width="100">
				</el-table-column>
				<el-table-column prop="expectDate" label="日期" align="center" width="150">
				</el-table-column>
				<el-table-column prop="dealDate" label="任务完成时间" width="150">
				</el-table-column>
				<el-table-column prop="vin" label="车架号" width="240">
				</el-table-column>
				<el-table-column prop="plateNum" label="车牌号" width="140">
				</el-table-column>
				<el-table-column prop="content" label="任务标题">
				</el-table-column>
				<el-table-column prop="status" label="任务状态" width="200" :formatter="statusFor">
				</el-table-column>
				<el-table-column prop="uname" label="处理人" width="80">
				</el-table-column>
			</el-table>
			<el-pagination small @size-change="handleSizeChanges" @current-change="handleCurrentChanges" :current-page="CurentPages" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout=" total,prev, pager, next" :total="detailData.total">
			</el-pagination>
		</el-row>
		<el-dialog title="报表说明" v-model="reportShow" size="tiny">
			<div style="overflow-y: scroll;height: 400px;">
				<b style="font-size: 15px;">流失回厂率：</b>&nbsp;&nbsp;<b style="font-size: 12px;">用于统计流失任务生成之后车辆回厂情况，车辆在任务提醒日期所在月与次月内进厂（工单产值大于0）算回厂</b><br><br>
				<b style="font-size: 15px;">客户经理：</b>&nbsp;&nbsp;<b style="font-size: 12px;">任务处理人员，未分配代表未下发的任务</b><br><br>
				<b style="font-size: 15px;">六个月-任务数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下当月任务小类为6个月的任务数</b><br><br>
				<b style="font-size: 15px;">六个月-回厂数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下当月任务小类为6个月的任务对应的车辆的回厂数量</b><br><br>
				<b style="font-size: 15px;">六个月-回厂率：</b>&nbsp;&nbsp;<b style="font-size: 12px;">六个月-回厂数/六个月-任务数，保留两位小数。七、八、九、十、十一、十二、十三与六月份配同</b><br><br>
				<b style="font-size: 15px;">流失总计：</b>&nbsp;&nbsp;<b style="font-size: 12px;">六个月+七个月+八个月+九个月+十个月+十一个月+十二个月+十三个月的流失任务数之和</b><br><br>
				<b style="font-size: 15px;">回厂总计：</b>&nbsp;&nbsp;<b style="font-size: 12px;">六个月+七个月+八个月+九个月+十个月+十一个月+十二个月+十三个月的流失任务对应的辆回厂数之和</b><br><br>
				<b style="font-size: 15px;">回厂率总计：</b>&nbsp;&nbsp;<b style="font-size: 12px;">回厂总计/流失总计，保留两位小数</b><br><br>
			</div>
		</el-dialog>
		<exports :tableId="tableId" :excelName="excelName" :template="template" v-on:backFunction="backFunction"></exports>
	</div>
</template>
<script>
	import exports from '../../plugins/exportModule.vue'
	import echarts from 'echarts'
	export default {
		data: function() {
			return {
				//查询条件
				area: '',
				brand: '',
				companyId: window.localStorage.getItem("companyId"),
				areaCombo: [],
				brandCombo: [],
				companyCombo: [],
				//baobiao shuoming
				reportShow: false,
				//表格显示
				table: true,
				msg: "123",
				//页码数
				CurentPage: 1,
				//每页的数量
				page: this.page,
				//分组数据
				tableData: {
					total: 0,
					dataList: []
				},
				time: '',
				//表格id
				tableId: '',
				//表格路径
				template: '',
				//表格名字
				excelName: '流失回厂率.xls',
				CurentPages: 1,
				//Mingxi
				detailShow: false,
				detailQueryData: {
					saId: '',
					typeCode: '',
					mDate: '',
					isBack: '',
				},
				detailData: {
					total: 0,
					dataList: []
				},
			}
		},
		methods: {
			handleSizeChanges: function() {

			},
			//baoxiandan fenye
			handleCurrentChanges: function(currentPage) {
				this.$data.CurentPages = currentPage;
				this.detatilQuery();
			},
			//fenyechaxun 
			detatilQuery: function() {
				this.$http({
					method: 'POST',
					url: this.API_ROOT + '/crm/kpi/carLostBack/detail', //url
					params: { //发送的参数
						companyId: this.$data.detailQueryData.companyId,
						saId: this.$data.detailQueryData.saId,
						mDate: this.$data.detailQueryData.mDate,
						isBack: this.$data.detailQueryData.isBack,
						typeCode: this.$data.detailQueryData.typeCode,
						limit: this.page.pageSize,
						start: this.$data.CurentPages
					}
				}).then(function(resp) {
					debugger;
					resp.data.total = parseInt(resp.data.total);
					this.$data.detailData = resp.data;
				}, function(error) {
					// error
				})
			},
			//返回
			back: function() {
				this.$data.detailShow = false;
				this.$data.CurentPages = 1;
				this.$data.detailData.dataList = [];
				this.$data.detailData.total = 0;
			},
			//查看明细
			lookdetail: function(item, num, type) {
				debugger;
				this.$data.detailShow = true;
				if(item.SA == '未分配') {
					this.$data.detailQueryData.saId = '未分配';
				} else {
					this.$data.detailQueryData.saId = item.saId;
				}
				if(this.$data.time == '') {
					var tiems = new Date();
					tiems = this.moment(tiems).format("YYYY-MM")
				} else {
					var tiems = this.moment(this.$data.time).format("YYYY-MM")
				}
				this.$data.detailQueryData.mDate = tiems;
				this.$data.detailQueryData.typeCode = type;
				this.$data.detailQueryData.companyId = item.companyId;
				if(num == '0') {
					this.$data.detailQueryData.isBack = "";
				} else {
					this.$data.detailQueryData.isBack = num;
				}

				this.$http({
					method: 'POST',
					url: this.API_ROOT + '/crm/kpi/carLostBack/detail', //url
					params: { //发送的参数
						companyId: this.$data.detailQueryData.companyId,
						saId: this.$data.detailQueryData.saId,
						mDate: this.$data.detailQueryData.mDate,
						isBack: this.$data.detailQueryData.isBack,
						typeCode: this.$data.detailQueryData.typeCode,
						limit: this.page.pageSize,
						start: this.$data.CurentPages
					}
				}).then(function(resp) {
					debugger;
					resp.data.total = parseInt(resp.data.total);
					this.$data.detailData = resp.data;
				}, function(error) {
					// error
				})

			},
			statusCov: function(row, column) {
				if(row.status == 0) {
					return '未完成';
				} else if(row.status == 1) {
					return '完成';
				} else if(row.status == 2) {
					return '关闭';
				}
			},
			isBackCov: function(row, column) {
				if(row.isBack == 0) {
					return '否';
				}
				if(row.isBack == 1) {
					return '是'
				}
			},
			//daochu 
			processOut: function() {
				this.$data.tableId = "lostBack";
				this.$data.template = "<template><div><div><div><table border='1'>{table}</table></div></div></div></template>";
			},
			//daochu fanhuihanshu
			backFunction: function() {
				this.$data.tableId = "";
			},
			//查看报表说明
			lookReport: function() {
				this.$data.reportShow = true;
			},
			//表格转换
			change: function() {
				if(this.$data.table == true) {
					this.$data.table = false;
				} else {
					this.$data.table = true;
				}
			},
			//六个月
			sixRate: function(row, column) {
				if(row.sixTaskNum != 0 && row.sixTaskBackNum != 0) {
					return(row.sixTaskBackNum / row.sixTaskNum * 100).toFixed(2) + "%";
				}
				return "0";
			},

			//七个月
			sevenRate: function(row, column) {
				if(row.sevenTaskNum != 0 && row.sevenTaskBackNum != 0) {
					return(row.sevenTaskBackNum / row.sevenTaskNum * 100).toFixed(2) + "%";
				}
				return "0";
			},
			//八个月
			eightRate: function(row, column) {
				if(row.eightTaskNum != 0 && row.eightTaskBackNum != 0) {
					return(row.eightTaskBackNum / row.eightTaskNum * 100).toFixed(2) + "%";
				}
				return "0";
			},
			//九个月
			nineRate: function(row, column) {
				if(row.nineTaskNum != 0 && row.nineTaskBackNum != 0) {
					return(row.nineTaskBackNum / row.nineTaskNum * 100).toFixed(2) + "%";
				}
				return "0";
			},
			//十个月
			tenRate: function(row, column) {
				if(row.tenTaskNum != 0 && row.tenTaskBackNum != 0) {
					return(row.tenTaskBackNum / row.tenTaskNum * 100).toFixed(2) + "%";
				}
				return "0";
			},
			//十一个月
			elevenRate: function(row, column) {
				if(row.elevTaskNum != 0 && row.elevTaskBackNum != 0) {
					return(row.elevTaskBackNum / row.elevTaskNum * 100).toFixed(2) + "%";
				}
				return "0";
			},
			//十二个月
			twlfRate: function(row, column) {
				if(row.twlfTaskNum != 0 && row.twlfTaskBackNum != 0) {
					return(row.twlfTaskBackNum / row.twlfTaskNum * 100).toFixed(2) + "%";
				}
				return "0";
			},
			//总计
			lsRate: function(row, column) {
				if(row.lsTaskNum != 0 && row.lsTaskBackNum != 0) {
					return(row.lsTaskBackNum / row.lsTaskNum * 100).toFixed(2) + "%";
				}
				return "0";
			},
			//查询
			baseQuery: function() {
				debugger;
				var dates;
				if(this.$data.time == '') {
					dates = this.$data.time;
				} else {
					dates = this.moment(this.$data.time).format("YYYY-MM");
				}
				if(this.$data.companyId == '') {
					this.$message.error("请选择公司！")
				} else {
					this.$http.post(this.API_ROOT + '/crm/kpi/carLostBack', this.$data.condition, {
							params: {
								mDate: dates,
								companyId: this.$data.companyId,
								area: this.$data.area,
								brand: this.$data.brand,
								start: this.$data.CurentPage,
								limit: 50
							}
						})
						.then(resp => {
							if(resp.data.success) {
								resp.data.total = parseInt(resp.data.total);
								// es5写法
								this.$data.tableData = resp.data;
								//this.baseQuery(this.$data.curTreeDeptId);
								//this.$data.exFormShow = false;
								//合计
								var sixTaskNum = 0;
								var sixTaskBackNum = 0;
								var sevenTaskNum = 0;
								var sevenTaskBackNum = 0;
								var eightTaskNum = 0;
								var eightTaskBackNum = 0;
								var nineTaskNum = 0;
								var nineTaskBackNum = 0;
								var tenTaskNum = 0;
								var tenTaskBackNum = 0;
								var elevTaskNum = 0;
								var elevTaskBackNum = 0;
								var twlfTaskNum = 0;
								var twlfTaskBackNum = 0;
								var thirTaskNum = 0;
								var thirTaskBackNum = 0;
								var lsTaskNum = 0;
								var lsTaskBackNum = 0;
								if(this.$data.tableData.dataList.length > 0) {
									for(var i = 0; i < this.$data.tableData.dataList.length; i++) {
										sixTaskNum += Number(this.$data.tableData.dataList[i].sixTaskNum);
										sixTaskBackNum += Number(this.$data.tableData.dataList[i].sixTaskBackNum);
										sevenTaskNum += Number(this.$data.tableData.dataList[i].sevenTaskNum);
										sevenTaskBackNum += Number(this.$data.tableData.dataList[i].sevenTaskBackNum);
										eightTaskNum += Number(this.$data.tableData.dataList[i].eightTaskNum);
										eightTaskBackNum += Number(this.$data.tableData.dataList[i].eightTaskBackNum);
										nineTaskNum += Number(this.$data.tableData.dataList[i].nineTaskNum);
										nineTaskBackNum += Number(this.$data.tableData.dataList[i].nineTaskBackNum);
										tenTaskNum += Number(this.$data.tableData.dataList[i].tenTaskNum);
										tenTaskBackNum += Number(this.$data.tableData.dataList[i].tenTaskBackNum);
										elevTaskNum += Number(this.$data.tableData.dataList[i].elevTaskNum);
										elevTaskBackNum += Number(this.$data.tableData.dataList[i].elevTaskBackNum);
										twlfTaskNum += Number(this.$data.tableData.dataList[i].twlfTaskNum);
										twlfTaskBackNum += Number(this.$data.tableData.dataList[i].twlfTaskBackNum);
										thirTaskNum += Number(this.$data.tableData.dataList[i].thirTaskNum);
										thirTaskBackNum += Number(this.$data.tableData.dataList[i].thirTaskBackNum);
										lsTaskNum += Number(this.$data.tableData.dataList[i].lsTaskNum);
										lsTaskBackNum += Number(this.$data.tableData.dataList[i].lsTaskBackNum);
									}
									debugger;
									//将合计值赋给dataList最后一行
									var length = this.$data.tableData.dataList.length;
									var addArray = {
										sa: '',
										sixTaskNum: '',
										sixTaskBackNum: '',
										sevenTaskNum: '',
										sevenTaskBackNum: '',
										eightTaskNum: '',
										eightTaskBackNum: '',
										nineTaskNum: '',
										nineTaskBackNum: '',
										tenTaskNum: '',
										tenTaskBackNum: '',
										elevTaskNum: '',
										elevTaskBackNum: '',
										twlfTaskNum: '',
										twlfTaskBackNum: '',
										thirTaskNum: '',
										thirTaskBackNum: '',
										lsTaskNum: '',
										lsTaskBackNum: '',
										oName:'',
										companyId:'',
									};
									this.$data.tableData.dataList = this.$data.tableData.dataList.concat(addArray);
									this.$data.tableData.dataList[length].SA = '合计';
									this.$data.tableData.dataList[length].sixTaskNum = sixTaskNum;
									this.$data.tableData.dataList[length].sixTaskBackNum = sixTaskBackNum;
									this.$data.tableData.dataList[length].sevenTaskNum = sevenTaskNum;
									this.$data.tableData.dataList[length].sevenTaskBackNum = sevenTaskBackNum;
									this.$data.tableData.dataList[length].eightTaskNum = eightTaskNum;
									this.$data.tableData.dataList[length].eightTaskBackNum = eightTaskBackNum;
									this.$data.tableData.dataList[length].nineTaskNum = nineTaskNum;
									this.$data.tableData.dataList[length].nineTaskBackNum = nineTaskBackNum;
									this.$data.tableData.dataList[length].tenTaskNum = tenTaskNum;
									this.$data.tableData.dataList[length].tenTaskBackNum = tenTaskBackNum;
									this.$data.tableData.dataList[length].elevTaskNum = elevTaskNum;
									this.$data.tableData.dataList[length].elevTaskBackNum = elevTaskBackNum;
									this.$data.tableData.dataList[length].twlfTaskNum = twlfTaskNum;
									this.$data.tableData.dataList[length].twlfTaskBackNum = twlfTaskBackNum;
									this.$data.tableData.dataList[length].thirTaskNum = thirTaskNum;
									this.$data.tableData.dataList[length].thirTaskBackNum = thirTaskBackNum;
									this.$data.tableData.dataList[length].lsTaskNum = lsTaskNum;
									this.$data.tableData.dataList[length].lsTaskBackNum = lsTaskBackNum;
									this.$data.tableData.dataList[length].oName = this.$data.tableData.dataList[length-1].oName;
									this.$data.tableData.dataList[length].companyId = this.$data.tableData.dataList[length-1].companyId;
								}
							} else {
								//debugger;
								this.$message.error(resp.data.msg);
							}
						}, resp => {});
				}
			},
			//列表，分页大小切换
			handleSizeChange: function() {},
			//列表,当前页切换
			handleCurrentChange: function(currentPage) {
				this.$data.CurentPage = currentPage;
				//this.$data.dictGroup = '';
				this.baseQuery();
			},
			//			//状态转换
			//			statusCov: function(row, column) {
			//				return row.newRemind == "0" ? '已预约' : '未预约';
			//			},
			//时间转换
			buyDates: function(row, column) {
				if(row.recordLength == "" || row.recordLength == null) return "";
				return moment(Number(row.recordLength)).format("YYYY-MM-DD");
			},
		
			//任务状态转换
			statusFor: function(row, column) {
				if(row.status == 1) {
					return "已完成"
				} else if(row.status == 2) {
					return "已关闭"
				} else {
					if(row.expectDate < this.moment(new Date().toISOString()).format("YYYY-MM-DD")) {
						return "任务已过期，请尽快处理！"
					}
				}
			},
		},
		//表单创建时执行
		created: function() {
//			this.baseQuery();
			
		},
		components: {
			exports
		}
	}
</script>
